UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8sm/eCMvg7wvl/GMaTcFzAzsAzFbe1tFHP+pR0JRBY=' 
WHERE 
  key_id = '9135d758ab15a3957fe53ff450b31a8754f8e8dad8dea57283121f110a521c8c' 
  AND (
    token = 'X8sm/eCMvg7wvl/GMaTcFzAzsAzFbe1tFHP+pR0JRBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036