UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c0hu2jnJkJ7areBxDTTJkolReo8YMrCrZXPA9w/++3A=' 
WHERE 
  key_id = '88db5c3adb81bd75c5b5373408146a22507dec9c4c52e8ae66e6c448fe05e7b0' 
  AND (
    token = 'c0hu2jnJkJ7areBxDTTJkolReo8YMrCrZXPA9w/++3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043