UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ndwZF7+Gk1TjHk3fGaXXk28FkgE5+PftD7jC/wLhbE=' 
WHERE 
  key_id = '46ed81ba737b7bcfa15cb42a10982b341fdbea2cf34392200744823c9322165f' 
  AND (
    token = '3ndwZF7+Gk1TjHk3fGaXXk28FkgE5+PftD7jC/wLhbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022