UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SN/2hCGBEd4P7Rg1cHnJm1z/QQuHLMwCfX+1652PziE=' 
WHERE 
  key_id = '1a62bc8c02b2c2560c2dc9e8cc5e01ec8356396e6756b95760a10e8e77b86dbb' 
  AND (
    token = 'SN/2hCGBEd4P7Rg1cHnJm1z/QQuHLMwCfX+1652PziE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030