UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Oy/vAvrpDAA48YzKwhbXvOduahIBCVfGQEupPQn9CI=' 
WHERE 
  key_id = 'eb49bedb0957bf60060adeb803d35822e3eb34519149b182fc4b7130445cca97' 
  AND (
    token = '1Oy/vAvrpDAA48YzKwhbXvOduahIBCVfGQEupPQn9CI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026