UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MLntyUYiAzFJYsaAQ/EaubRlHA2E+/fa3ljMoQ2GUFk=' 
WHERE 
  key_id = 'aa706f4526936a77d33eac9d9d13db96d35a5054b3be95f64fcc7e7097ebd54d' 
  AND (
    token = 'MLntyUYiAzFJYsaAQ/EaubRlHA2E+/fa3ljMoQ2GUFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027