UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZYB5qki29fv8sdyKJFnhKeSToLZcC3/iHmjJNiRGpwI=' 
WHERE 
  key_id = '0176722ca3f869f0acd4fdaa7e7381312db1787cb2e850aab4fdbd7c46b211e7' 
  AND (
    token = 'ZYB5qki29fv8sdyKJFnhKeSToLZcC3/iHmjJNiRGpwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023