UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0UAWEcLSC0NXV8hlHQCINwImfhORQ1g65Q3Uo0tDzmQ=' 
WHERE 
  key_id = 'f2b5aef10941bbb6dc3562d9b8e9c6cfc4872c2c6416055a57c44bfda46d28f0' 
  AND (
    token = '0UAWEcLSC0NXV8hlHQCINwImfhORQ1g65Q3Uo0tDzmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044