UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tLA4I1Z7C1C1z4XNHFb0Wvkj4IVjP6CPMmXDCHsVjkg=' 
WHERE 
  key_id = '8506d3eb4ba12fd87d2be515556de8884d3e06835fd04253122fee81b75e2d33' 
  AND (
    token = 'tLA4I1Z7C1C1z4XNHFb0Wvkj4IVjP6CPMmXDCHsVjkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033