UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xvp1s/fXagi8obqZBMPPAuzruqxsttbkgiYIGxsY93M=' 
WHERE 
  key_id = '692865d7307d47a2256d7c30bfe349d882ffd0bd14966e03ea20fa64d5a901e3' 
  AND (
    token = 'Xvp1s/fXagi8obqZBMPPAuzruqxsttbkgiYIGxsY93M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038