UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5OkQDnmNWMitr4BDNxQTutiMdkLPdBLLSZijFmLhwcA=' 
WHERE 
  key_id = '7809cb01f79734e83b1ad55e90426f32e87e18d1443c8f2e06cfc124a7e8a49c' 
  AND (
    token = '5OkQDnmNWMitr4BDNxQTutiMdkLPdBLLSZijFmLhwcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017