UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'et51Nj01055NS0YBL6f0+c2H+7flIbAZhfjiF/Zxpk0=' 
WHERE 
  key_id = '99db62c34a838633e700a3b4b14da9251697caf2a6995199ae7102d688c5ee14' 
  AND (
    token = 'et51Nj01055NS0YBL6f0+c2H+7flIbAZhfjiF/Zxpk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042