UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WiB6L6Om8NrxARGPl7CaHD/mKDoM0/7WCbLZQ29tXyo=' 
WHERE 
  key_id = 'e1caced60712a7a298610f57089b6178a386e3f4e6ae06083a353e5675efd72b' 
  AND (
    token = 'WiB6L6Om8NrxARGPl7CaHD/mKDoM0/7WCbLZQ29tXyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041