UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F79JX6OoEmhkqC6OPuXcJvm8R6pTBuIgg/Iwl3jEtlI=' 
WHERE 
  key_id = '08e8419ccc999ce5adf47b04ef28aea4c3ac61c0ca1355241368b2cc51404e17' 
  AND (
    token = 'F79JX6OoEmhkqC6OPuXcJvm8R6pTBuIgg/Iwl3jEtlI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037