UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A3Gl8wa7RdpmfEYktmyNcTE/Ne8IS4GQ8M89AQrHRXY=' 
WHERE 
  key_id = 'fdba18da4c9e181d592e8983e3b918f6c961d87d997ad6695d55ad1ac5f20c86' 
  AND (
    token = 'A3Gl8wa7RdpmfEYktmyNcTE/Ne8IS4GQ8M89AQrHRXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025