UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtRWoOcw0LeP9wUfYWzNjPHKtrKJu39Ec/4I4jkQb7w=' 
WHERE 
  key_id = '3f10534b81ddb883e2749d77a4082722358596e48c86e61c963443c9ceeb9ba8' 
  AND (
    token = 'xtRWoOcw0LeP9wUfYWzNjPHKtrKJu39Ec/4I4jkQb7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024