UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ot5lajyybuom3Om6e7LmXAvHsMPqEGVIRFMXZuMW0FE=' 
WHERE 
  key_id = '1ee0756d14831fc5dc95e0b3b5e166bb09587f199dda56aea3b91f119bdb63b7' 
  AND (
    token = 'ot5lajyybuom3Om6e7LmXAvHsMPqEGVIRFMXZuMW0FE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015