UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gfvTSRDpg/FJf/OCoD+aiPBAO9MzVWXroNZnOue6Vy0=' 
WHERE 
  key_id = '28e31037a611c1a9c5cd43aa909d33b143b78055fa5c679041d9e89aa1b5c860' 
  AND (
    token = 'gfvTSRDpg/FJf/OCoD+aiPBAO9MzVWXroNZnOue6Vy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032