UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2V/mlX4y/KCogGCnl9tm5wxVedk6Zm5iqemktTYeDD8=' 
WHERE 
  key_id = '2ecbc80bd8db8f4677ef1c499417f9451704777dd5243e98f7b4d05cb1f5c032' 
  AND (
    token = '2V/mlX4y/KCogGCnl9tm5wxVedk6Zm5iqemktTYeDD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043