UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hcNqLkWH4d1Gfmg/bzs0aiHUKKWLisM9pt2OTTMsvss=' 
WHERE 
  key_id = '2cc98ea3779ecf0515c3ffe5be640de7093504d42c9a7623b826743dde5e18ba' 
  AND (
    token = 'hcNqLkWH4d1Gfmg/bzs0aiHUKKWLisM9pt2OTTMsvss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036