UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nwsAwkXOdVE3olc8LoPviU3IxgYedDhq3GzZhdwnuNE=' 
WHERE 
  key_id = '108aa97f6ffe659d78fb51d797151530a0ccbdbd9bb3c6578eed6098ffe220f0' 
  AND (
    token = 'nwsAwkXOdVE3olc8LoPviU3IxgYedDhq3GzZhdwnuNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026