UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V/OgB/5vu04SbrJ6YQYKlJTmxUM4qidANBBEoVrSk0g=' 
WHERE 
  key_id = 'e8b1ae9a7ac49deec7294500d04f97a5d92b5e1b59a341302a66aa0a601fe170' 
  AND (
    token = 'V/OgB/5vu04SbrJ6YQYKlJTmxUM4qidANBBEoVrSk0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031