UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mcr9hX8bm+o7GLLYdYxlpTiv5AWFkTHcv7Eb5FF/rI8=' 
WHERE 
  key_id = 'fea68cf42c3cdf41570a499d54030873ad12aede3beb34d0a420668b28558cdc' 
  AND (
    token = 'mcr9hX8bm+o7GLLYdYxlpTiv5AWFkTHcv7Eb5FF/rI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041