UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '16nIb9QlMJU3+pNr2TDP7DHdWZ3upyRAvFpLcbXmSew=' 
WHERE 
  key_id = 'e2971ff031f719efb76152fcefa1ba62fd653a1108c935564b2b0e642f74e8ba' 
  AND (
    token = '16nIb9QlMJU3+pNr2TDP7DHdWZ3upyRAvFpLcbXmSew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015