UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DXoFwnhT8XGV6Y/6Azi0nAfpSOT8zOEkZre7ScLess=' 
WHERE 
  key_id = '6542da046dbc4d5fe005eb37e172cd1d9eb19690cdf1e2501e831bc3749b3624' 
  AND (
    token = '3DXoFwnhT8XGV6Y/6Azi0nAfpSOT8zOEkZre7ScLess=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032