UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WH14Q3ozOi3wpwCYUwyMYScSJUNuACWzJTavCqK28gM=' 
WHERE 
  key_id = '25f482f09365d9c0992f90b3f9b866da56233719764ae1190eaaf3cb56b989eb' 
  AND (
    token = 'WH14Q3ozOi3wpwCYUwyMYScSJUNuACWzJTavCqK28gM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027