UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/uBVt0OPxE1Xf+eoFFr2tvsVQRQZ2/UVqGhJWYiErME=' 
WHERE 
  key_id = '50201e8c32f98d26f0411e50c15f8b589d4c4dedf700d7ab9bd8446b2c8110d6' 
  AND (
    token = '/uBVt0OPxE1Xf+eoFFr2tvsVQRQZ2/UVqGhJWYiErME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036