UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W0s0ormkcV2aFLdMrxLS3/vAeHgVr8MGCN5JuIohG1c=' 
WHERE 
  key_id = '35c870cbb6a4d2261f68aff89d67d59bddc46072f32d5d8fce6e394bcdcc8748' 
  AND (
    token = 'W0s0ormkcV2aFLdMrxLS3/vAeHgVr8MGCN5JuIohG1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039