UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zDxAV8mWQ0YE1nOXae/5pcp5XA+0VwmxwpUe98n82ec=' 
WHERE 
  key_id = 'b3580d3395b4b8a4018d44d872e36d9226c3e5ec839aba265000a77f608ee08c' 
  AND (
    token = 'zDxAV8mWQ0YE1nOXae/5pcp5XA+0VwmxwpUe98n82ec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025