UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LwxLkuEuifM3HJJXq/fFrYzVcHwWTfL+jJkf7fG2e9Q=' 
WHERE 
  key_id = 'f32c35246e1eda1e180fbe8d0cec2fddc907c1531b6ae587b8415ab9c6760d56' 
  AND (
    token = 'LwxLkuEuifM3HJJXq/fFrYzVcHwWTfL+jJkf7fG2e9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035