UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QeYXfUusK5eEbo1Bk32x69zrtqzsEqU6P/7VKkTlPuQ=' 
WHERE 
  key_id = 'e573ab0cfd8cd513c79e4c6083f18b371b46f7e112c200402c96a0651ff9f9c7' 
  AND (
    token = 'QeYXfUusK5eEbo1Bk32x69zrtqzsEqU6P/7VKkTlPuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024