UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vpzRF0SNFqnoWp3ck2khrJMnsmMcig4wcVPU4pHPNEo=' 
WHERE 
  key_id = '3ab312eacce2d542fb376a5952f593acd38b734789f3c22485bb62d997712d3e' 
  AND (
    token = 'vpzRF0SNFqnoWp3ck2khrJMnsmMcig4wcVPU4pHPNEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027